You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(agent-reply-validator): [#2904] add the agent reply schema and validator - #2952
Related to #2904. Task T3 of its Implementation Plan: the JSON reply files of decision D18 get a schema and a validator.
Why
Issue #2904 migrates the Copilot-era custom agents (.github/agents/*.agent.md) to Claude Code agents under an explicit orchestrator. Its specification (docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md, merged in #2905) splits the work into small pull requests that merge one at a time: T1 the specification (#2905), T2 the pointer CLAUDE.md files (#2920), T3 this pull request, T4 to T8 the agents (pr-review-handler, task-reviewer, implementer, pr-reviewer, researcher), T9 the orchestrator, T10 the removal of .github/agents/, T11 the measurement, and T12 the close-out.
Decision D18 makes every agent the orchestrator starts write one JSON reply file per reply, in agent-replies/ of the issue specification's folder. The files are the trace of the agents' work: who replied, on which task or pull request, in which round, with which verdict and findings. Their format is strict, so a schema can check it, and the orchestrator decides its next step from the verdict field alone. One validator checks every reply file: its name, its content against the schema, and that the two agree. The repository checks run it on every reply file in a pull request, and the stop hook of task-reviewer (T5) will run it before the agent may finish.
The agents of T4 to T9 write these files, and T5's stop hook calls the validator, so the format and the validator come first. The specification lists them with the pointer files as the foundations the agents refer to. This pull request adds no agent and no reply file yet; it adds what the next tasks need.
What this adds
A new crate contrib/dev-tools/checks/agent-reply-validator (an AI-harness workspace member, not a default member; admitted in .dockerignore), built in five test increments:
The reply file name <agent>-<subject>-r<round>.json: the agents that write reply files (the P1 roster without pr-review-handler), t<task> or pr<number>, round 1 to 3.
The strict content model: all eleven D18 fields required, no unknown field, schema-version 1, no blank text, created-utc as YYYY-MM-DD HH:MM with calendar validity, closed lists of verdicts and severities, objects only. A rejection names the JSON path and the reason.
The checks of one file: its place (docs/issues/<drafts|open|closed>/<specification>/agent-replies/), name, content, and that the name agrees with agent, subject and round. Every problem is reported.
The command agent-reply-validator (class no-stdout-result: NDJSON on stderr, exit 0, 1 or 2). --all checks the staged content of every file in an agent-replies/ folder or named like a reply file, so a misplaced reply is found; with paths it checks those files on disk, as the stop hook of T5 will. A symbolic link is rejected.
The schema docs/schemas/agent-reply-v1.schema.json, generated from the model with schemars; agent-reply-schema writes it, and a test fails when the tracked file drifts from the model.
The pre-commit hook and the Docs Lint workflow run agent-reply-validator --all; the run-pre-commit-checks skill lists the step.
docs/schemas/README.md, docs/index.md, the package catalog and the CLI output contract ADR describe the crate and its two binaries.
The specification marks T3 DONE.
New dependencies, latest stable at the time (cargo search): schemars 1.2.3, serde_path_to_error 0.1.20, clap 4.6.8, and regex 1.13.2 as a dev-dependency (to check that each schema pattern accepts and rejects the same samples as the Rust check). The others were already in the workspace.
Review before this pull request
Each increment had an independent test-design review by a subagent, under the write-unit-test skill, before its commit; the whole task had a task review under review-task. All are recorded in docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/agent-review-reports.md with their findings and what was done about them. Three of the five increment reviews failed in round 1 and passed in round 2. One finding was a real bug: serde also reads a struct from a JSON array, so a reply written as an array was accepted. For each increment the author removed each rule in turn (mutation check) and confirmed that a test failed.
Two choices the maintainer was asked about and did not settle; the recommended option was taken: the schema is generated from a Rust model (as frontmatter-validator does), and the per-increment design review is made by an independent subagent.
Validation
cargo test -p agent-reply-validator: 157 unit tests, 6 tests of the command's helpers, 23 command-boundary tests and 2 schema tests passed (counts at the head that carries the round-4 fixes).
…reply files
Adds the agent-reply-validator crate, an AI-harness workspace member that is not a default member, with the parser of reply file names: <agent>-<subject>-r<round>.json, where the agent writes reply files, the subject is t<task> or pr<number>, and the round is 1 to 3 (D18 of issue torrust#2904). The independent test-design review of this increment is recorded in agent-review-reports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… reply files
Adds the strict model of a reply file's JSON content (D18 of issue torrust#2904): every field required, no unknown field, schema version 1, no blank text, created-utc as YYYY-MM-DD HH:MM with calendar validity, closed lists of verdicts and severities. A rejected reply names the JSON path and the reason. The independent test-design review of this increment is recorded in agent-review-reports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and content of a reply file
Adds the checks of one reply file from its repository-relative path and its text: it must be in docs/issues/<drafts|open|closed>/<specification>/agent-replies/, its name and content must be valid, and the name must agree with the agent, subject and round fields (D18 of issue torrust#2904). Every problem is reported. The independent test-design review of this increment is recorded in agent-review-reports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ator command
Adds the command, class no-stdout-result: NDJSON records on stderr, exit 0, 1 or 2. With --all it checks the staged content of every file in an agent-replies folder or named like a reply file, so misplaced replies are found; with paths it checks those files on disk, whatever their names, as the stop hook of T5 will. A symbolic link is rejected. The independent test-design review of this increment is recorded in agent-review-reports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…v1 JSON Schema
Generates docs/schemas/agent-reply-v1.schema.json from the reply model with schemars; the agent-reply-schema binary writes it, and a test fails when the tracked file drifts from the model. A reply or a finding written as a JSON array is now rejected, as the schema says object. The module doc lists where the model is stricter than the schema. The independent test-design review of this increment is recorded in agent-review-reports.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the pre-commit hook and Docs Lint
Both run agent-reply-validator --all, which checks the staged content of every file in an agent-replies folder or named like a reply file (D18 of issue torrust#2904). The run-pre-commit-checks skill lists the new step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…schema and validator
Adds the agent-reply-v1 section to docs/schemas/README.md, the crate to the package catalog, and its two binaries to the CLI output contract ADR as no-stdout-result commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ly schema too
The docs/schemas/README.md row of the documentation index named only the frontmatter schema.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…dent review
The T3 row is DONE, the specification names the T3 branch, and the Progress Log and agent-review-reports.md record the task-level review (REVIEW PASSED) and how its findings were addressed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Adds a new Rust dev-tool crate to validate AI agent reply JSON files (D18 / issue #2904), including a generated JSON Schema artifact and repo integrations to run the validator in hooks and CI.
Changes:
Introduces agent-reply-validator crate with strict reply model + file/name/location checks, NDJSON stderr output, and a companion agent-reply-schema generator.
Adds and tracks docs/schemas/agent-reply-v1.schema.json generated from the Rust model with a drift test.
Wires the validator into pre-commit and the Docs Lint workflow; updates docs/ADR/package catalog/spec to reflect T3 completion.
File
Description
project-words.txt
Adds a spellchecker allow-word used in new Rust tests.
docs/schemas/agent-reply-v1.schema.json
Adds the tracked generated JSON Schema for agent replies (v1).
docs/schemas/README.md
Documents schema generation/drift checks and how to run the validator.
…no --version
clap adds no version flag unless asked, so --version is a usage error; the doc comment of the arguments now says so, and the command test of the usage-error record already runs --version.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the Rust regex engine
JSON Schema patterns are ECMA-262; the tests read them with the Rust regex engine, so they show agreement on their samples, not equivalence. A comment and the assertion messages now say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…f PR torrust#2952
Creates the audit record of this pull request with Copilot's three comments: F1 and F3 fixed, F2 declined with its reason.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The validator accepts object-form verdicts and severities despite the string-only schema, and its --all mode accepts staged symlinks that path mode rejects.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Reject staged symlinks before validating blob text
[Minor][F6] Check staged file modes before validating blob text
tracked_paths discards entry modes, so --all accepts a symlink whose stored target text is a valid reply JSON document and whose name and location agree. This approves a dangling link that path mode explicitly rejects. Read the mode from the index, reject symlinks before parsing their blobs, and add an --all regression test; working-tree metadata would not preserve staged-content semantics.
[Major][F4] Require string-only verdicts and severities
The derived enum deserializers accept "verdict": {"REVIEW_PASSED": null} and "severity": {"Major": null} in otherwise-valid replies, although the schema requires strings (Serde's object-form enum reader, upstream default branch rather than the locked release). The later shape check misses both values, so the gate can approve a verdict that consumers comparing against the documented strings cannot interpret. Deserialize both enums through String and add object-form rejection tests; the same issue affects Severity at line 133.
…es from strings only
Serde's derived enum reader also takes the object form, such as {"REVIEW_PASSED": null}, which the schema does not allow. Both fields are now read from a JSON string, with a rejection case each. Found by Copilot's review 5964554730 on PR torrust#2952 (F4).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… as a symbolic link
With --all the validator read a staged symbolic link's content, which is the link's target path, and checked it as a reply. It now reads each entry's mode from the index and rejects a candidate staged as a link, as path mode already does, with a command test. Found by Copilot's review 5964554730 on PR torrust#2952 (F6).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Response to Copilot's review 5964554730, its two findings in the review body (no inline threads; recorded as F4 and F6 under the review's IDs in docs/pr-reviews/pr-2952-review/PR-REVIEW.md):
F4 (Major), FIXED in fix(agent-reply-validator): [#2904] read verdicts and severities from strings only, pushed: verdict and severity are read from a JSON string, so the object form such as {"REVIEW_PASSED": null} is rejected, as the schema says; a rejection case each, and removing either change fails its case.
F6 (Minor), FIXED in fix(agent-reply-validator): [#2904] reject a reply file staged as a symbolic link, pushed: --all reads each entry's mode with git ls-files --stage and rejects a candidate staged as a symbolic link, as path mode does; a command test stages a link whose target text is a valid reply, and removing the check fails it.
…f PR torrust#2952
Records Copilot's two review-body findings F4 and F6, both fixed, with the conversation response as their reply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at 09d254476bd1e0fe98a2fda7a8df5d52dd294179. Recomputed from the bytes at this head, against the merge base 96923f0d2; git merge-tree against develop7a4c16eaf writes a tree with no conflict (develop is six commits ahead and touches none of the 27 files).
Process: a feature with a new tool crate, so add-workspace-member, add-rust-dependency, write-unit-test, implement-workflow, run-pre-commit-checks, open-pull-request and process-pr-review govern it. The crate is a member, not a default member, and admitted in .dockerignore; the hook, the Docs Lint step and the skill's step list agree; the description says Related to, as a partial task should.
The change against its claim: name parsing, the strict content model (string-only verdicts and severities, object-only reply and findings, duplicate keys, trailing text, calendar check), the file checks, --all over the index with staged links rejected, path mode, the NDJSON records and exit codes, and the generated schema do what the description says; the link and object-form tests fail with their fixes reverted. The round-3 audit commit records F7 with its row, detail entry, own-thread reply and log entry; its times and its 28-test count recompute.
Consistency: the ADR rows, package catalog, index row, the T3 row and the dictionary word (replacen, used in reply.rs) check out; no changed Markdown adds a relative link that fails to resolve. The audit validator's logic, run offline on the capture, reports 6 rows and 0 failures, and all four threads have a reply, a row and a resolution.
Hygiene: 16 commits, Conventional with the [#2904] reference, author = committer; each carries one attribution footer line (no rule in the tree on it), and the description carries one attribution footer line too. git diff --check is clean, the skill's commit-id check prints nothing, and no closing keyword appears in the title, body or messages.
Findings: F1 (Minor) the schemas README calls the validator stricter where it is looser for U+FEFF; F2 to F4 (Nit). None blocks: each is repairable after merge, and the list the README points to is correct.
Checked, no finding: the leading-zero, plus-sign and byte-wrap cases of names and rounds; first_non_object after the typed read; agreement only when name and content are valid; the location rule's dot folders; GIT_INDEX_FILE kept and the redirect variables cleared; repository-relative paths from a subfolder; the drift test's path.
Checks
On the loop's compute node at this head, against the merge base 96923f0d2 (receipt server-gates-kranich-1218): the repository's pre-commit gate and lint roster exit 0 (109 s wall), and the audit validator passes this pull request's record (6 rows, 4 log entries, 0 failures). In a fresh per-PR target directory at 6dedbd867, whose Rust sources this head leaves unchanged (it adds one audit commit), cargo test --workspace passes 4396 tests with 0 failed and 5 ignored across 129 binaries (378 s wall), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean (44 s wall). cargo deny check exits 5 with the same 35 license rejections and four advisories as on develop, so this pull request changes nothing in that result. Checked against the bytes at posting: the audit record at this head carries the thread discussion_r4625468317 (line 133), which is why the round-1 finding on it was dropped. The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "". At posting, develop is f212ae33b.
ACK 09d2544 — the reply-file validator, its generated schema, its hook and workflow wiring and the round-3 audit record recomputed from the bytes at this head, with the audit validator's logic passing offline
…tor differs on blank text
The README called the validator stricter than the schema for blank text. It is for U+0085 and the other way for U+FEFF; the README now gives the direction per character, as the module documentation does, and names the 32-bit limit of a subject number.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a subject number as a schema difference
The subject pattern has no length bound, while the parser reads the number as a u32, so t4294967296 matches the pattern and the validator rejects it. The module documentation lists it, and a test pins it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hema binary by its modification time
The argument-refusal test compared only the artifact's content, which a write of the same content leaves unchanged. It now compares the modification time too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at 2feb9add7fe66a74fcb136e62929e23bb5968715. Recomputed from the bytes at this head, against the merge base 96923f0d2; git merge-tree against developf212ae33b writes a tree with no conflict (develop is ten commits ahead and touches none of the 27 files). This round reads what moved since 09d254476: four commits and the forge record.
The change against its claim: ed09f5c60 makes the schemas README say the validator differs from the schema and gives the direction per blank-text character (a text of only U+0085 passes the schema and fails the validator, U+FEFF the reverse) and the 32-bit subject limit. 39df36ac1 adds that limit to the module doc's list and pins it with a test on t4294967296. 51eb2bc93 compares the artifact's modification time as well as its content, so a write of identical bytes fails the refusal test. 2feb9add7 records round 4: rows F8 to F11 for this review's threads, with the reviewer's IDs F1 to F4 kept in the detail entries because of the collision with round 1, the bracket severities, the replies on their own threads, the fixing commit subjects (the reply URL for the description edit) and a log entry whose times match the capture.
State of the earlier findings: F1 to F4 are fixed at this head (the README; the module doc and its test; the refusal test; the description, whose counts 157, 6, 23 and 2 recompute), replied to and resolved.
Consistency and hygiene: the audit validator's logic, run offline on the capture, reports 10 rows, 5 log entries and 0 failures; all eight threads have a reply, a row and a resolution; the detail entries follow the template's field order. The four commits are Conventional with [#2904], author = committer, each with one attribution footer line (no rule in the tree on it). git diff --check is clean, the skill's commit-id check prints nothing, and no closing keyword appears in the title, body or messages.
Findings: none.
Checked, no finding: the README's per-character direction against ECMA-262 and Unicode White_Space; u32::MAX + 1 as the test's sample; the modification-time comparison where the platform gives none (both sides None); the round-4 rows' author class and categories; the Processing Log's order.
Checks
On the loop's compute node at this head, against the merge base 96923f0d2 (receipt server-gates-kranich-1226): the repository's pre-commit gate and lint roster exit 0 (370 s wall), and the audit validator passes this pull request's record (10 rows, 5 log entries, 0 failures). In this PR's own target directory at 51eb2bc93, whose Rust sources this head leaves unchanged (it adds one audit commit), cargo test --workspace passes 4397 tests with 0 failed and 5 ignored across 129 binaries (86 s wall, incremental), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean. Checked against the bytes at posting: the audit record at this head names each of the four threads of review 5971081099 (discussion_r4625703462, …469, …474, …481). The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "". At posting, develop is f212ae33b.
ACK 2feb9ad — the round-2 fixes of the four earlier findings and the round-4 audit record recomputed from the bytes at this head, with the audit validator's logic passing offline
da4bfcc docs(pr-reviews): [#2904] record the reply and resolution of PR #2963 review round 4 (josecelano-bot)
14c510b docs(pr-reviews): [#2904] record PR #2963 review round 4 in the audit before replying (josecelano-bot)
37a1450 docs(issues): [#2904] name the round definition of V6 and count review round 4 (josecelano-bot)
3ec1086 docs(pr-reviews): [#2904] record the replies and resolutions of PR #2963 review round 3 (josecelano-bot)
0a751f7 docs(pr-reviews): [#2904] record PR #2963 review round 3 in the audit before replying (josecelano-bot)
3bffe75 docs(pr-reviews): [#2904] give the F9 verification of PR #2963 a check that holds (josecelano-bot)
0a94063 docs(issues): [#2904] check AC3 with the evidence of scenario M3 (josecelano-bot)
6576113 docs(issues): [#2904] name the source of the wait-ceiling variable in V3 (josecelano-bot)
d220278 docs(issues): [#2904] store the records of the M3 runs and count review rounds 2 and 3 (josecelano-bot)
f3bc03f docs(pr-reviews): [#2904] record PR #2963 review round 2 in the audit (josecelano-bot)
8db3b0b docs(pr-reviews): [#2904] count six sections in the F1 verification of PR #2963 (josecelano-bot)
647ffe7 docs(pr-reviews): [#2904] name the heads of PR #2963 round 1 by commit subject (josecelano-bot)
e277292 docs(issues): [#2904] store the session's listing and the agent's reply of the M1 run (josecelano-bot)
a84d265 docs(issues): [#2904] say how many commits addressed the review of T4 (josecelano-bot)
c3fe6b0 docs(issues): [#2904] mark scenario M3 and task T4 done (josecelano-bot)
7c97816 docs(issues): [#2904] record scenario M3 and the first round count of AC9 (josecelano-bot)
e3ad74d docs(pr-reviews): [#2904] add the audit record of PR #2963 review round 1 (josecelano-bot)
594b0fb docs(issues): [#2904] update last-updated-utc of the manual verification evidence (josecelano-bot)
2ef09d1 docs(issues): [#2904] log the task review of T4 in the Progress Log (josecelano-bot)
fde106a docs(issues): [#2904] narrow the inventory note on loading AGENTS.md to the handler (josecelano-bot)
7d565da docs(issues): [#2904] say in V1 that the agent file changed after the run (josecelano-bot)
1014adb docs(issues): [#2904] store the records of the M1 and M2 run in the repository (josecelano-bot)
7044dcb docs(issues): [#2904] record the task review of T4 and check AC2 (josecelano-bot)
67d4f43 docs(issues): [#2904] correct where the M1 transcript holds the preloaded skills (josecelano-bot)
8c35789 docs(wait-for-pr-review): [#2904] say that the session syncs the branch before it delegates (josecelano-bot)
ab9a747 docs(agents): [#2904] align pr-review-handler with the review of task T4 (josecelano-bot)
614232d docs(issues): [#2904] mark task T4 in progress with M1 and M2 done (josecelano-bot)
47e8e2b docs(issues): [#2904] record scenarios M1 and M2 for pr-review-handler (josecelano-bot)
9c73efc docs(issues): [#2904] start the inventory of the removed profiles' rules (josecelano-bot)
4a168aa docs(process-pr-review): [#2904] say which agent runs the workflow (josecelano-bot)
9daae1a docs(wait-for-pr-review): [#2904] say which agent runs a review round (josecelano-bot)
6814d72 feat(agents): [#2904] add the pr-review-handler agent (josecelano-bot)
Pull request description:
Related to #2904. Task T4 of its Implementation Plan: the first Claude Code agent, `pr-review-handler`.
## Why
Issue #2904 migrates the Copilot-era custom agents (`.github/agents/*.agent.md`) to Claude Code agents under an explicit orchestrator. Claude Code does not read `.github/agents/`, so none of those profiles has run since the move to Claude Code. The specification (`docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md`) splits the work into small pull requests that merge one at a time: T1 the specification (#2905), T2 the pointer `CLAUDE.md` files (#2920), T3 the reply schema and validator (#2952), **T4 this pull request**, T5 to T8 the other agents, T9 the orchestrator, T10 the removal of `.github/agents/`, T11 the measurement and T12 the close-out.
The review role comes first (decision D4): review loops have been the main cost of recent work, and the maintainer decided that the role that addresses reviews runs on Opus 5.5 at minimum, with the result measured. A Claude Code agent can pin its model (D13), so the role no longer depends on the model the session happens to run on.
## What this adds
- `.claude/agents/pr-review-handler.md`: processes one round of review feedback, from Copilot, a person or another bot, through the preloaded `process-pr-review` workflow, and returns a short report. It replaces the Copilot-only `copilot-suggestions-handler`, which stays until T10 (D16). Following P2, it holds only the role: identity, tools, the pinned model `claude-opus-5-5`, inputs and the report; the workflow stays in the skills it preloads (`process-pr-review`, `fetch-review-threads`, `resolve-review-threads`, `commit-changes`). It starts no agent (D3), writes no reply file (D18: its audit record `PR-REVIEW.md` is its trace), and returns findings that need the contributor's decision as questions.
- `wait-for-pr-review` and `process-pr-review` say who runs a round: the session that owns the pull request may delegate the processing of one event to the agent, after bringing the branch to the event's commit, and keeps the poller, the checks, the re-request, the round count and the exit condition.
- `removed-profile-rules.md` in the specification's folder: the inventory of acceptance criterion AC6, started with every rule of `copilot-suggestions-handler` and where it lives once the profile is gone. Its ten rows: five rules were already in `process-pr-review` or `AGENTS.md`, three went to the agent file (identity, tools, inputs), and two are dropped ("use the Committer agent for commits" under D14, and the Copilot keys `user-invocable` and `disable-model-invocation`).
- Scenarios M1 and M2, recorded in `manual-verification-evidence.md` sections V1 and V2. From a session on `claude-sonnet-5-5`, the agent loaded, its four skills were preloaded, and its transcript shows `claude-opus-5-5`. Of the `tools` it lists, `Grep` and `Glob` do not exist in Claude Code 2.1.318 and were dropped silently; V1 records it.
- The specification: T4 `DONE`, M1, M2 and M3 `DONE`, AC2 and AC3 checked, and the round counts for AC9 (section V6).
## Scenario M3 ran on this pull request
M3 needs one real review round, on a real pull request, processed by the agent from fetch to resolved threads. It ran on the first review round of this pull request (review `5972182565`, findings F1 to F6). A Claude Code session reads agent files when it starts, so the round was delegated by new non-interactive sessions in this branch's checkout. It took three runs, recorded in `manual-verification-evidence.md` section V3: the first was stopped after 10 minutes because the session started the agent in the background; the second stopped at a question, because the reviewed head was ACKed during the round; the third pushed the fixes and the audit record `docs/pr-reviews/pr-2963-review/PR-REVIEW.md`, replied to and resolved the six threads, and `validate-audit-record.py` exited `0`. The agent ran on `claude-opus-5-5` in all three.
## Review before this pull request
An independent task review under `review-task` (a subagent on Claude Opus 5.5) passed. It found two minor issues and three nits, and gave two suggestions, all recorded in `agent-review-reports.md`. All were applied except keeping `Grep` and `Glob` in `tools`, which stay for the builds that have them.
## Validation
- The pre-commit gate passed for every commit (`linter all`, the frontmatter and skill checks, `agent-reply-validator --all`, the documentation tests).
- `cargo run -q -p agent-review-report-contract` passed after the skill changes.
- The reviewer ran `lychee --offline` on the changed Markdown files: 20 of 20 links resolved.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
ACKs for top commit:
da2ce7:
ACK da4bfcc — the round-4 fix, reply and row were recomputed at this head, with every thread replied to, recorded and resolved and the validator's logic passing offline
josecelano:
ACK da4bfcc
Tree-SHA512: f4a2514506bb977ae7ac3e561548e58ca749764f87f3cb8fbb8422ee00d5b20613f0b00aa01f37647d3d23d3b121fbed9ba86a62f91ad5c2b12cd55384f84180
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #2904. Task T3 of its Implementation Plan: the JSON reply files of decision D18 get a schema and a validator.
Why
Issue #2904 migrates the Copilot-era custom agents (
.github/agents/*.agent.md) to Claude Code agents under an explicit orchestrator. Its specification (docs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/ISSUE.md, merged in #2905) splits the work into small pull requests that merge one at a time: T1 the specification (#2905), T2 the pointerCLAUDE.mdfiles (#2920), T3 this pull request, T4 to T8 the agents (pr-review-handler,task-reviewer,implementer,pr-reviewer,researcher), T9 theorchestrator, T10 the removal of.github/agents/, T11 the measurement, and T12 the close-out.Decision D18 makes every agent the orchestrator starts write one JSON reply file per reply, in
agent-replies/of the issue specification's folder. The files are the trace of the agents' work: who replied, on which task or pull request, in which round, with which verdict and findings. Their format is strict, so a schema can check it, and the orchestrator decides its next step from theverdictfield alone. One validator checks every reply file: its name, its content against the schema, and that the two agree. The repository checks run it on every reply file in a pull request, and the stop hook oftask-reviewer(T5) will run it before the agent may finish.The agents of T4 to T9 write these files, and T5's stop hook calls the validator, so the format and the validator come first. The specification lists them with the pointer files as the foundations the agents refer to. This pull request adds no agent and no reply file yet; it adds what the next tasks need.
What this adds
contrib/dev-tools/checks/agent-reply-validator(an AI-harness workspace member, not a default member; admitted in.dockerignore), built in five test increments:<agent>-<subject>-r<round>.json: the agents that write reply files (the P1 roster withoutpr-review-handler),t<task>orpr<number>, round 1 to 3.schema-version1, no blank text,created-utcasYYYY-MM-DD HH:MMwith calendar validity, closed lists of verdicts and severities, objects only. A rejection names the JSON path and the reason.docs/issues/<drafts|open|closed>/<specification>/agent-replies/), name, content, and that the name agrees withagent,subjectandround. Every problem is reported.agent-reply-validator(classno-stdout-result: NDJSON on stderr, exit 0, 1 or 2).--allchecks the staged content of every file in anagent-replies/folder or named like a reply file, so a misplaced reply is found; with paths it checks those files on disk, as the stop hook of T5 will. A symbolic link is rejected.docs/schemas/agent-reply-v1.schema.json, generated from the model withschemars;agent-reply-schemawrites it, and a test fails when the tracked file drifts from the model.agent-reply-validator --all; therun-pre-commit-checksskill lists the step.docs/schemas/README.md,docs/index.md, the package catalog and the CLI output contract ADR describe the crate and its two binaries.DONE.New dependencies, latest stable at the time (
cargo search):schemars1.2.3,serde_path_to_error0.1.20,clap4.6.8, andregex1.13.2 as a dev-dependency (to check that each schema pattern accepts and rejects the same samples as the Rust check). The others were already in the workspace.Review before this pull request
Each increment had an independent test-design review by a subagent, under the
write-unit-testskill, before its commit; the whole task had a task review underreview-task. All are recorded indocs/issues/open/2904-2003-migrate-custom-agents-to-claude-code/agent-review-reports.mdwith their findings and what was done about them. Three of the five increment reviews failed in round 1 and passed in round 2. One finding was a real bug: serde also reads a struct from a JSON array, so a reply written as an array was accepted. For each increment the author removed each rule in turn (mutation check) and confirmed that a test failed.Two choices the maintainer was asked about and did not settle; the recommended option was taken: the schema is generated from a Rust model (as
frontmatter-validatordoes), and the per-increment design review is made by an independent subagent.Validation
cargo test -p agent-reply-validator: 157 unit tests, 6 tests of the command's helpers, 23 command-boundary tests and 2 schema tests passed (counts at the head that carries the round-4 fixes).cargo clippy -p agent-reply-validator --all-targets -- -D warningsexited 0.cargo run -q -p agent-reply-validator --bin agent-reply-validator -- --allon this branch: exit 0, no reply files yet.docker build --target recipe --file Containerfile .exited 0 with the new workspace member.Not in this pull request
git.rsof the command copies the one offrontmatter-validator; a shared crate belongs to the harness-workspace work of EPIC Overhaul: Automation Tools and AI Agent Guardrails #2003.🤖 Generated with Claude Code